
<?php
	//header("Content-Type:text/html;charset=utf-8");
	$con=mysql_connect('localhost','root','dx123');
	//选择数据库
	mysql_select_db("novel");
	//组织sql语句
	$sql="select name from province";
	//执行sql语句
	$resouse=mysql_query($sql,$con);
	//var_dump($resouse);
	//使用json数据格式
	$res='[';
	while($row=mysql_fetch_row($resouse))
	{
		$res.="{'"."name':"."'".$row[0]."',},";
		//echo count($row);
	}
	$res.=']';
	mysql_free_result($resouse);
	mysql_close();
	echo $res;
?>